<?php
/**
 * PrynLib
 * @copyright 2007-2009 Prynel
 * @author Olivier ROGER <roger.olivier@gmail.com>
 * @category libPrynel
 * @package Form
 * @version $Revision: 80 $
 */

/**
 * Element submit
 * @category libPrynel
 * @package Form
 * @subpackage Form_Element
 * @version 1.0.0 
 * @author Olivier ROGER <roger.olivier@gmail.com>
 * @copyright  2007-2008 Prynel
 *       
 *
 */
class Form_Element_Submit extends Form_Input
{
	/**
	 * Constructeur
	 *
	 * @param string $nom
	 * @param Form_Form $form
	 * @access public
	 */
	public function __construct($nom,$form)
	{
		parent::__construct($nom,$form);
		if(!isset($this->attrs['type']))
			$this->attrs['type'] = 'submit';
	}
	
	/**
	 * Ecrit l'objet
	 *
	 * @access public
	 * @return unknown
	 */
	public function __toString()
	{
		$css = implode(' ',$this->class);
		if($css!='')
			$css = 'class="'.$css.'"';
		else
			$css ='';

		$attributs = $this->attrsToString();
		$field = "\t".'<input '.$css.' value="'.htmlspecialchars($this->value).'" '.$attributs.' />'."\n";
		if($this->fieldNewLine)
			$field.="\t".'<br />'."\n";
		return $field;
	}
}
 ?>